package com.run2code.design.behavioral.memento;

/**
 * 文本编辑器的状态
 * 关注公众号【奔跑的码畜】，一起进步不迷路
 *
 * @author 第七人格
 * @date 2024/06/12
 */
public class TextEditorState {
    /**
     * 文本
     */
    private String text;
    /**
     * 游标位置
     */
    private int cursorPosition;
  
    public TextEditorState(String text, int cursorPosition) {  
        this.text = text;  
        this.cursorPosition = cursorPosition;  
    }  
  
    public String getText() {  
        return text;  
    }  
  
    public int getCursorPosition() {  
        return cursorPosition;  
    }

    public void setText(String text) {
        this.text = text;
    }

    public void setCursorPosition(int cursorPosition) {
        this.cursorPosition = cursorPosition;
    }
}